<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>编辑商品</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  #parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid layui-form">
  <div class="layui-card">
    <div class="layui-card-header">商品基础信息</div>
    <div class="layui-card-body">
      <input type="hidden" name="id" value="$!{id}"/>
      <input type="hidden" name="typeCodes" value="$!{typeCodes}">
      <input type="hidden" name="marketResToken" value="$!{marketResToken}">
	  <input type="hidden" name="supplierId" value="$!{supplierId}">
      <div class="layui-row">
        <div class="layui-col-sm4">
          <label class="layui-form-label">缩列图</label>
          <input type="text" name="thumbnailImg" autocomplete="off" class="layui-input" value="$!{thumbnailImg}">
        </div>
        <div class="layui-col-sm8">
          <label class="layui-form-label">展示图</label>
          <input type="text" name="imgs" autocomplete="off" class="layui-input" value="$!{imgs}">
        </div>
      </div>
      <div class="layui-row">
        <div class="layui-col-sm11">
          <div class="layui-form-item">
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-block">
              <input type="text" name="name" lay-verify="required" placeholder="请输入商品名称" autocomplete="off" class="layui-input" value="$!{name}">
            </div>
          </div>
        </div>
      </div><!-- /.layui-row -->
      <div class="layui-row">
        <div class="layui-col-sm4">
          <div class="layui-form-item">
            <label class="layui-form-label">商品分类</label>
            <div class="layui-input-block">
                <select name="classify">
                  #foreach($item in $classifyList)
                  <option value="$!{item.index()}" $!{utils.eq($item.index(),$classify,'selected')}>$!{item.note()}</option>
                  #end
                </select>
            </div>
          </div>
        </div>
        <div class="layui-col-sm8">
          <div class="layui-form-item">
            <label class="layui-form-label">商品类型</label>
            <div class="layui-input-block" id="types"></div>
          </div>
        </div>
      </div>
      <div class="layui-row">
        <div class="layui-col-sm4">
          <div class="layui-form-item">
            <label class="layui-form-label">零售价</label>
            <div class="layui-input-block">
              <input type="text" name="payMoneyStr" lay-verify="required" placeholder="请输入零售价" autocomplete="off" class="layui-input" value="$!{payMoneyStr}">
            </div>
          </div>
        </div>
        <div class="layui-col-sm8">
          <div class="layui-form-item">
            <label class="layui-form-label">促销标签</label>
            <div class="layui-input-block">
              <input type="text" name="labels" placeholder="请输入促销标签，已英文逗号分割线，如：新品,网红商品" autocomplete="off" class="layui-input" value="$!{labels}">
            </div>
          </div>
        </div>
      </div>
    </div><!-- /.layui-card-body -->
  </div><!-- /.layui-card -->
  <div class="layui-card">
    <div class="layui-card-header">商品详情图</div>
    <div class="layui-card-body">
      <input type="text" name="detailImgs" autocomplete="off" class="layui-input" value="$!{detailImgs}">
    </div>
  </div>
  #if($id)
  <div class="layui-card">
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <button class="layui-btn layui-btn-fun" data-type="addSpace">新增商品规格</button>
      </div>
      <table id="LAY-table" lay-filter="LAY-table"></table>
      <script type="text/html" id="imgTpl">
        <img style="display: inline-block; width: 100%; height: 100%;" src= {{ d.thumbnailImg }}>
      </script>
      <script type="text/html" id="LAY-table-toolbar">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateSpace"><i class="layui-icon layui-icon-edit"></i>编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delSpace"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </script>
    </div>
  </div>
  #end
  <div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  </div>
</div>
#parse('/footFiles.html')
<script>
layui.config({
  base: '$!{webRoot}/layuiadmin/' //静态资源所在路径
  ,webRoot:'$!{webRoot}'
  ,resDomain:'$!{marketResDomain}'
}).extend({
  index: 'lib/index' //主入口模块
  ,goods_edit:'market/goods_edit'
}).use(['index', 'form', 'goods_edit'])
</script>
</body>
</html>